From fa8286aa900ea4f13c1c15d5b0f441436f042d8a Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 3 Nov 2024 17:30:17 +0000
Subject: feature(web): Add the ability to view the bookmarks of a particular
 rss feed

---
 apps/web/app/dashboard/feeds/[feedId]/page.tsx | 31 ++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 apps/web/app/dashboard/feeds/[feedId]/page.tsx

(limited to 'apps/web/app/dashboard/feeds/[feedId]/page.tsx')

diff --git a/apps/web/app/dashboard/feeds/[feedId]/page.tsx b/apps/web/app/dashboard/feeds/[feedId]/page.tsx
new file mode 100644
index 00000000..ed5f9e40
--- /dev/null
+++ b/apps/web/app/dashboard/feeds/[feedId]/page.tsx
@@ -0,0 +1,31 @@
+import { notFound } from "next/navigation";
+import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks";
+import { api } from "@/server/api/client";
+import { TRPCError } from "@trpc/server";
+
+export default async function FeedPage({
+  params,
+}: {
+  params: { feedId: string };
+}) {
+  let feed;
+  try {
+    feed = await api.feeds.get({ feedId: params.feedId });
+  } catch (e) {
+    if (e instanceof TRPCError) {
+      if (e.code == "NOT_FOUND") {
+        notFound();
+      }
+    }
+    throw e;
+  }
+
+  return (
+    <Bookmarks
+      query={{ rssFeedId: feed.id }}
+      showDivider={true}
+      showEditorCard={false}
+      header={<div className="text-2xl">{feed.name}</div>}
+    />
+  );
+}
-- 
cgit v1.2.3-70-g09d2

